#include "LinkedList.h"
#include "common.h"

LinkedList::LinkedList(int val)
{
	value = val;
	next = NULL;
}

LinkedList::~LinkedList()
{
	if(next) delete next;
}

void LinkedList::append(int val)
{
	if(value == val) return;
	if(next) next->append(val);
	next = new LinkedList(val);
}

void LinkedList::print()
{
	printf("%d", value);
	if(next)
	{
		printf("\t");
		next->print();
	}
}
